//
//  STLeftHeadView.swift
//  STMusic
//
//  Created by stoneobs on 16/10/19.
//  Copyright © 2016年 stoneobs. All rights reserved.
// 左边tableview 头部 --差 40 废弃

import UIKit

class STLeftHeadView: UIView {

    var iconButton:STButton = STButton()
    var nickLabel:STLabel = STLabel()
    var numLabel:STLabel = STLabel()
    var setButton:STButton = STButton()
    var likeButton:STButton = STButton()
    var mangerButton:STButton = STButton()
  override init(frame: CGRect) {
    super.init(frame: frame);
    initSubViews();
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func initSubViews() -> Void {
        backgroundColor = UIColor.gray;
        let leftWidth = SCREEN_WIDTH - 40;
        
        iconButton = STButton.init(frame: CGRect.init(x: 15, y: 60, width: 80, height: 80), title: "", titleColor: nil, titleFont: 0, cornerRadius: 0, backgroundColor: nil, backgroundImage: PeopleImage, image: nil);
        addSubview(iconButton);
        
        nickLabel = STLabel.init(frame: CGRect.init(x: iconButton.right + 10, y: iconButton.top + 10, width: 100, height: 20), text: "zhangtai", textColor: UIColor.black, font: 12, isSizetoFit: true, textAlignment: .center);
        
        addSubview(nickLabel);
        
        numLabel = STLabel.init(frame: .init(x: nickLabel.left, y: nickLabel.bottom + 20, width: 100, height: 20), text: "今天你的音乐被听多少次", textColor: .black, font: 12, isSizetoFit: true, textAlignment: .center);
        addSubview(numLabel);
        
        setButton = STButton.init(frame: .init(x: 0, y: 160, width: leftWidth/3, height: 40), title: "设置", titleColor: FirstTextColor, titleFont: 13, cornerRadius: 0, backgroundColor: .white, backgroundImage: nil, image: nil);
        setButton.showRightLine(0);
        addSubview(setButton);
        
        likeButton = STButton.init(frame: .init(x: leftWidth/3, y: 160, width: leftWidth/3, height: 40), title: "喜欢", titleColor: FirstTextColor, titleFont: 13, cornerRadius: 0, backgroundColor: .white, backgroundImage: nil, image: nil);
        addSubview(likeButton);
        
        mangerButton = STButton.init(frame: .init(x: 2 * leftWidth/3, y: 160, width: leftWidth/3, height: 40), title: "我离线的", titleColor: FirstTextColor, titleFont: 13, cornerRadius: 0, backgroundColor: .white, backgroundImage: nil, image: nil);
        mangerButton.showLeftLine(0);
        addSubview(mangerButton);
        
        
        
        
        
        
    }
}
